#include "sdlMusicMonitor.h"
#include "SDL/SDL_mixer.h"

unsigned sdlMusicMonitor::counter = 0;
sdlMusicMonitor* sdlMusicMonitor::instancia = NULL;
sdlMonitor* sdlMusicMonitor::monitorSDL = NULL;

sdlMusicMonitor* sdlMusicMonitor::getInstance(){
	if (instancia == NULL){
		instancia = new sdlMusicMonitor;
		monitorSDL = sdlMonitor::getInstance();
	}
	counter++;
	return instancia;
}
void sdlMusicMonitor::eliminar(){
	counter --;
	if (counter == 0 && instancia != NULL){
		delete instancia;
		sdlMonitor::eliminar();
	}
}

sdlMusicMonitor::sdlMusicMonitor(){
	Mix_OpenAudio(22050,MIX_DEFAULT_FORMAT,2,4096);
}

sdlMusicMonitor::~sdlMusicMonitor(){
	Mix_CloseAudio();
}

sdlMusicMonitor::sdlMusicMonitor(const sdlMusicMonitor&){}

void sdlMusicMonitor::operator=(const sdlMusicMonitor&){}
